package handler;

import java.util.List;

import bean.CompactDisc;

import com.google.gson.Gson;

import dao.CompactDiscDao;

public class LoadDiscHandler implements IHandler{

	public String process() {
    	List<CompactDisc> lists;
		try {
			lists = CompactDiscDao.getCompactDiscs();
		} catch (Exception e) {
			return "Load discs :" + e.getMessage();
		}
    	String data = "{\"identifier\": \"id\", \"items\": "+new Gson().toJson(lists)+"}";
    	return data;
	}
	
}
